import com.gy.dao.UserDaoMysqlImpl;
import com.gy.dao.UserDaoOracleImpl;
import com.gy.dao.UserDaoSQLServerImpl;
import com.gy.service.UserService;
import com.gy.service.UserServiceGeneralImpl;

/**
 * @Classname MyTest2
 * @Description TODO
 * @Date 2021/5/23 18:02
 * @Created by Administrator
 */
public class MyTest2 {
    public static void main(String[] args) {
        //用户实际调用的是业务层，dao层他们不需要接触
        UserService userService = new UserServiceGeneralImpl();
        ((UserServiceGeneralImpl) userService).setUserDao(new UserDaoMysqlImpl());
        ((UserServiceGeneralImpl) userService).setUserDao(new UserDaoOracleImpl());
        ((UserServiceGeneralImpl) userService).setUserDao(new UserDaoSQLServerImpl());

        userService.getUser();
    }
}
